<?php
namespace Home\Model;

class ModelHouseModel extends ContentModel {
	
	/**
	 * 获得文章内容详细
	 * @param unknown $id 文章ID
	 */
	public function detail($cate = null, $id) {
		if($id && $modelHouse = M("ModelHouse")->find($id)) {
			$model = $this->getModel($modelHouse['category']);
			$model['modelName'] = $this->getModelName($model['tag']);
			$condition = array(
					"this0.customer" => $modelHouse['customer'],
					"this0.is_deleted" => 0,
					"this0.id" => $id,
			);
			$data = M()->table("__MODEL_HOUSE__ this0")->join("LEFT JOIN __MODEL_HOUSE_CONFIG__ this1 on this0.id=this1.id")->where($condition)->find();
			return array('data'=>$data, 'model' => $model);
		} else return array();
	}
	
}